package errdef

/********************* 错误码 ********************/

type ErrCode struct {
	code          int32
	defaultErrMsg string
}

func NewErrCode(code int32, defaultErrMsg string) *ErrCode {
	return &ErrCode{code, defaultErrMsg}
}

var (
	/********************* 3xxxx 基础异常 ********************/

	ParamErr = NewErrCode(30001, "参数异常")
	LoginErr = NewErrCode(30002, "登录异常")
	AuthErr  = NewErrCode(30003, "权限异常")

	/********************* 4xxxx 基础异常 ********************/

	DefaultBizErr = NewErrCode(40001, "未知业务异常")

	/********************* 5xxxx 系统异常 ********************/

	ServerErr = NewErrCode(50001, "服务器内部错误")
	DBErr     = NewErrCode(50002, "数据库异常")
)
